<?php

/**
 * NotaAvaliacao form base class.
 *
 * @package    form
 * @subpackage nota_avaliacao
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseNotaAvaliacaoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_nota_avaliacao'  => new sfWidgetFormInputHidden(),
      'id_aluno_turma'     => new sfWidgetFormDoctrineChoice(array('model' => 'AlunoTurma', 'add_empty' => false)),
      'id_turma_avaliacao' => new sfWidgetFormDoctrineChoice(array('model' => 'TurmaAvaliacao', 'add_empty' => false)),
      'nu_nota'            => new sfWidgetFormInput(),
      'st_nota_avaliacao'  => new sfWidgetFormInput(),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
      'deleted'            => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_nota_avaliacao'  => new sfValidatorDoctrineChoice(array('model' => 'NotaAvaliacao', 'column' => 'id_nota_avaliacao', 'required' => false)),
      'id_aluno_turma'     => new sfValidatorDoctrineChoice(array('model' => 'AlunoTurma')),
      'id_turma_avaliacao' => new sfValidatorDoctrineChoice(array('model' => 'TurmaAvaliacao')),
      'nu_nota'            => new sfValidatorNumber(),
      'st_nota_avaliacao'  => new sfValidatorString(array('max_length' => 1)),
      'created_at'         => new sfValidatorDateTime(array('required' => false)),
      'updated_at'         => new sfValidatorDateTime(array('required' => false)),
      'deleted'            => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('nota_avaliacao[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'NotaAvaliacao';
  }

}
